

<?php $__env->startSection('css'); ?>
    <link rel="stylesheet" href="/vendor/daterangepicker/daterangepicker.css">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <div class="admin-content">

        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">新增活动</strong> /
                <small>Create</small>
            </div>
        </div>
        <hr>
        <?php echo $__env->make('admin._flash', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-12">

                <form class="am-form" action="/admin/active/<?php echo e($active->id); ?>" method="post">
                    <?php echo e(csrf_field()); ?>

                    <?php echo e(method_field('PUT')); ?>



                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            所属门店
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <select  data-am-selected="{btnWidth: '100%',  btnStyle: 'secondary', btnSize: 'sm', maxHeight: 360, searchBox: 1}"
                                     name="store_id">
                                <option value="">请选择</option>
                                <?php $__currentLoopData = $cates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($c->id); ?>" <?php if($c->id == $active->store_id): ?> selected <?php endif; ?>><?php echo e($c->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            标题
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="title" value="<?php echo e($active->title); ?>" class="am-input-sm"placeholder="请输入标题">
                        </div>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            简介
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <textarea rows="4" name="active_about"   placeholder="请输入简介"><?php echo e($active->active_about); ?></textarea>
                        </div>
                    </div>
                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            规则
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <textarea rows="4" name="active_rule"  placeholder="请输入规则"><?php echo e($active->active_rule); ?></textarea>
                        </div>
                    </div>



                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            活动开始时间-结束时间
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="date" id="date_start" value="<?php echo e($active->active_start); ?>至<?php echo e($active->active_end); ?>" class="am-input-sm " value="" placeholder="点击选择开始时间结束时间"  >
                        </div>
                    </div>

                    <div class="am-g am-margin-top sort">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            成功打卡数
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" name="use_number" value="<?php echo e($active->use_number); ?>"  class="am-input-sm"placeholder="完成活动所需的打卡数，10次则填写10">
                        </div>
                    </div>

                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            奖励优惠券
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <th><?php $__currentLoopData = $coupons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <label class="am-btn am-btn-default am-btn-xs am-round" >
                                        <input type="radio" name="coupon_id" value="<?php echo e($c->id); ?>" <?php if($c->id == $active->coupon_id): ?> checked <?php endif; ?> > <?php echo e($c->ratio); ?>折,适用范围：<?php $__currentLoopData = $c->types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php echo e($t->name); ?>_ <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </label><br>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </th>
                        </div>
                    </div>
                    
                    
                    
                    
                    
                    
                    
                    










                    <div class="am-margin">
                        <button type="submit" class="am-btn am-btn-primary am-radius">提交保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script src="/vendor/daterangepicker/moment.js"></script>
    <script src="/vendor/moment/locale/zh-cn.js"></script>
    <script src="/vendor/daterangepicker/daterangepicker.js"></script>

    <script>
        $(function () {
            //时间插件
            $('#date_start').daterangepicker({

                "autoUpdateInput": false,
                "autoApply": true,
                "locale": {
                    "format": "YYYY-MM-DD",
                    "applyLabel": "确定",
                    "cancelLabel": "取消"
                }
            }, function (start, end, label) {
                this.element[0].value = start.format('YYYY-MM-DD') + ' ~ ' + end.format('YYYY-MM-DD');
            });
        });

    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin.application', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>